package com.myhome.mappers;

import com.myhome.domain.Coin;
import com.myhome.dto.AdminBankDto;
import com.myhome.dto.CoinDto;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author QYiXin
 * @Date 2021 10 29 15 42
 **/
@Mapper(componentModel = "spring")
public interface CoinMappers {
    CoinMappers INSTANCE = Mappers.getMapper(CoinMappers.class);

    /**
     * 将entity转化为dto
     *
     * @param source
     * @return
     */
    CoinDto convert2Dto(Coin source);

    /**
     * 将dto对象转化为entity对象
     *
     * @param source
     * @return
     */
    Coin convert2Entity(CoinDto source);


    /**
     * 将entity转化为dto
     *
     * @param source
     * @return
     */
    List<CoinDto> convert2Dto(List<Coin> source);

    /**
     * 将dto对象转化为entity对象
     *
     * @param source
     * @return
     */
    List<Coin> convert2Entity(List<CoinDto> source);
}
